package com.kly.springbootinit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.kly.springbootinit.model.dto.exam.ExamQueryRequest;
import com.kly.springbootinit.model.entity.Exam;
import com.kly.springbootinit.model.vo.ExamVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 考试服务
 *
 * @author <a href="https://github.com/likly">程序员鹿七</a>
 * @from <a href="https://www.code-nav.cn">编程导航学习圈</a>
 */
public interface ExamService extends IService<Exam> {

    /**
     * 校验数据
     *
     * @param exam
     * @param add 对创建的数据进行校验
     */
    void validExam(Exam exam, boolean add);

    /**
     * 获取查询条件
     *
     * @param examQueryRequest
     * @return
     */
    QueryWrapper<Exam> getQueryWrapper(ExamQueryRequest examQueryRequest);
    
    /**
     * 获取考试封装
     *
     * @param exam
     * @param request
     * @return
     */
    ExamVO getExamVO(Exam exam, HttpServletRequest request);

    /**
     * 分页获取考试封装
     *
     * @param examPage
     * @param request
     * @return
     */
    Page<ExamVO> getExamVOPage(Page<Exam> examPage, HttpServletRequest request);
}
